package com.six.core.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.six.core.entity.Role;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    @Select("select distinct role_id from acl_emp_role  WHERE emp_id=#{roleId}")
    List<Integer> findByUserId(Integer roleId);


    @Insert("INSERT into acl_emp_role (role_id,emp_id,gmt_create) values(#{roleId},#{userId},NOW())")
    Integer fenUserRole(@Param("roleId")Integer roleId, @Param("userId")Integer userId);


}
